//
//  MoreInfoCell.m
//  WashForU
//
//  Created by 王俊 on 15/11/29.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "MoreInfoCell.h"

@implementation MoreInfoCell

- (void)awakeFromNib {
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

+(instancetype)initWithTitle:(NSString*)title andImageName:(NSString*) imageName{
    MoreInfoCell   *cell       = [[MoreInfoCell alloc]initWithStyle:UITableViewCellStyleValue1   reuseIdentifier:REUSECELLLID];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    UIImageView    *image      = [[UIImageView alloc]init];
    UILabel        *label      = [[UILabel alloc]init];
    UIImageView    *arrowImage = [[UIImageView alloc]init];
    
    label.text          = title;
    label.font          = [UIFont CustomFont:16];
    label.textColor     = [UIColor GrayColor_88];
    label.textAlignment = NSTextAlignmentLeft;
    image.image         = [UIImage imageNamed:imageName];
    arrowImage.image    = [UIImage imageNamed:@"右箭头"];
    
    [cell addSubview:image];
    [cell addSubview:label];
    [cell addSubview:arrowImage];
    
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(30, 30));
        make.leading.equalTo(cell).offset(15);
        make.centerY.equalTo(cell);
    }];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(100, 30));
        make.centerY.equalTo(image);
        make.leading.equalTo(image.mas_trailing).offset(10);
    }];
    [arrowImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(image);
        make.size.mas_equalTo(CGSizeMake(8, 13));
        make.trailing.equalTo(cell).offset(-10);
    }];    
    
    return cell;
}

@end
